package com.linux.huhx.socket;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

/**
 * Created by huhx on 2017-06-29.
 */
public class MainClient {
    public static void main(String[] args) {
        try {
            Socket socket = new Socket("localhost", 9999);
            BufferedReader inFromServer = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            String line = inFromServer.readLine();
            System.out.println(line);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
